import Vue from 'vue';
import Router from 'vue-router';
import Layout from '../views/layout';
import MainLayout from '../views/layout/MainLayout';
import Login from '../views/common/login';
import baseSet from '../views/mainContent/baseSetting';
import actManage from '../views/mainContent/activityManage';
import dataReports from '../views/mainContent/dataReports';
Vue.use(Router);

export default new Router({
    mode: 'history',
    routes: [
        {
            path: '/activityManage',
            component: Layout,
            redirect: '/activityManage/activityList/actList',
            meta: { title: '活动管理', module: 'activityManage' },
            children: [
                {
                    path: 'activityList',
                    component: MainLayout,
                    meta: { title: '活动列表' },
                    children: [
                        { path: 'actList', component: actManage.ActivityList, name: 'actList', meta: { title: '活动列表', fullpath: '/activityManage/activityList/actList' }},
                        
                    ]
                },
                {
                    path: 'activityModel',
                    component: MainLayout,
                    meta: { title: '活动模版' },
                    children: [
                        { path: 'activityModelList', component: actManage.ActivityModel, name: 'activityModel', meta: { title: '活动模版', fullpath: '/activityManage/activityModel/activityModelList' } },
                    ]
                }
            ]
        },
        {   
            path: '/baseSetting',
            component: Layout,
            meta: { title: '基础设置', module: 'baseSetting' },
            redirect: '/baseSetting/accountManage/accountList',
            children: [
                {
                    path: 'accountManage',
                    component: MainLayout,
                    meta: { title: '帐号管理' },
                    children: [
                        { path: 'accountList', component: baseSet.AccountList, name: 'accountList', meta: { title: '帐号列表', fullpath: '/baseSetting/accountManage/accountList' } },
                        { path: 'accountFrom', component: baseSet.AccountForm, name: 'accountForm', meta: { title: '帐号编辑', fullpath: '/baseSetting/accountManage/accountFrom', hidden: true } },
                    ]
                },
                {
                    path: 'businessesManage',
                    component: MainLayout,
                    meta: { title: '商户管理' },
                    children: [
                        { path: 'businessesList', component: baseSet.BusinessesList, name: 'businessesList', meta: { title: '商户列表', fullpath: '/baseSetting/businessesManage/businessesList' } },
                        { path: 'businessesForm', component: baseSet.BusinessesForm, name: 'businessesForm', meta: { title: '新建商户', fullpath: '/baseSetting/businessesManage/businessesForm', hidden: true } },
                    ]
                }
            ]
        },
        // {
        //     path: '/dataReports',
        //     component: Layout,
        //     meta: { title: '数据报表', module: 'dataReports' },
        //     redirect: '/dataReports/activityOrders/voucherOrder/voucherOrderList',
        //     children: [
        //         {
        //             path: 'activityOrders',
        //             component: MainLayout,
        //             meta: { title: '活动订单' },
        //             children: [
        //                 { path: 'voucherOrder/voucherOrderList', component: dataReports.VoucherOrder, name: 'voucherOrderList', meta: { title: '抢券订单', parent: 'dataReports' } },
        //             ]
        //         },
        //         {
        //             path: 'reports',
        //             component: MainLayout,
        //             meta: { title: '报表数据' },
        //             children: [
        //                 { path: 'activityReport/activityReportList', component: dataReports.ActivityReport, name: 'activityReportList', meta: { title: '抢券订单', parent: 'dataReports' } },
        //                 { path: 'awardReport/awardReportList', component: dataReports.AwardReport, name: 'awardReportList', meta: { title: '抢券订单', parent: 'dataReports' } },
        //             ]
        //         },
        //         {
        //             path: '/systemLogs',
        //             component: MainLayout,
        //             meta: { title: '系统日志' },
        //             children: [
        //                 // { path: '/voucherOrder', component: dataReports.VoucherOrder, name: 'voucherOrder', meta: { title: '抢券订单', parent: 'dataReports' } },
        //             ]
        //         },
                
        //     ]
        // },
        {
            path: '/login',
            redirect: '/login',
            meta: { hidden: true },
            component: Login,
        }
    ]
})